<template>
  <TestSlots>
    <template v-for="(slotKey, slotIndex) in $slots" :key="slotIndex" #[slotKey]="data">
      <slot :name="slotKey" :data="data"></slot>
    </template>
  </TestSlots>
</template>

<script setup lang="ts">
import { ref, useSlots } from 'vue';
import TestSlots from './TestSlots.vue'
const $slots = Object.keys(useSlots())
</script>

<style scoped></style>